
<%@ include file="../common.jsp"%>
<script type="text/javascript">
	$(document).ready(
		
			function() {
				$("#subCategory").attr("action",'<c:url value="/saveDocSubCategory.htm"></c:url>');
				$("#dscName").focus();
			});
	loadOnChangeMethods();
		
</script>

<form:form commandName="documentSubCategory" id="subCategory">
	<table class="adminFilterTable">
		<tr class="tableChildHeaderColor">
			<td colspan="5" align="center"> ADD DOCUMENT SUB-CATEGORY </td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Name* </td>	
			<td class="spacingColumnWidthLess"></td>
			<td class="formField"> <form:input path="dscName" id="dscName"/>
				 <label class="formLabel"> <form:errors path="dscName" cssClass="errorMessage"></form:errors> </label>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Code* </td>
			<td class="spacingColumnWidthLess"></td>	
			<td class="formField"> <form:input path="dscCode" id="dscCode"/>
				 <label class="formLabel"> <form:errors cssClass="errorMessage" path="dscCode"></form:errors> </label>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Parent Document Type </td>
			<td class="spacingColumnWidthLess"></td>
			<td class="formField"> <select id="docTypeID">
					<option value="0">Choose Type</option>
					<c:forEach items="${docTypeMap}" var="item">
						<option value="${item.key}">${item.value}</option>
					</c:forEach>
				</select>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Parent Document Category </td>
			<td class="spacingColumnWidthLess"></td>	
			<td class="formField"> <form:select path="dscParentCategory.dcId" id="docCatID"></form:select> </td>
			<td class="spacingColumnWidthLess"></td>
		</tr>	
		<tr class="formSpacingRow"><td></td> </tr>
		<tr class="odd" align="center">
			<td class="spacingColumnWidthLess"></td>
			<td></td>
			<td class="spacingColumnWidthLess"></td>
			<td colspan="2">
				<input class="formButton ui-corner-all" type="button" value="Save" onclick="javascript:addEntity('subCategory')">
			</td>
		</tr>			
		<tr class="formSpacingRow"><td></td> </tr>
	</table>
</form:form>
<c:if test="${errorCount eq 0}">
	<c:choose>
		<c:when test="${resultOfEntry}">
			Operation Done Successfully
		</c:when>
		<c:otherwise>
			<label class="errorMsg"> Error. </label>
		</c:otherwise>
	</c:choose>
</c:if>